<template>
	<view class="myOrderListAre">
		<view class="display column calc myOrderList borderR" v-for="(item,index) in orderList" :key="index" v-if="type=='order'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre" @click="shopClick(item.supplier_content.id)">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{item.supplier_content.supplier_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
					<text class="themeColor">{{item.statusText}}</text>
				</view>
				<view class="display flow orderItemAre" @click="orderClick(item.id)">
					<image :src="item.product_content.head_img" class="shopImg" ></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{item.product_content.product_name}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>{{item.product_content.integral}}积分</text>
								<text class="pColor">x{{item.num}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="display flow mainAre">
					<view class="display column">
						<text>合计：<text class="price">{{item.all_integral}}积分</text></text>
					</view>
					<button class="orderBtn themeBgColor" @click="logisticsClick(item)" v-if="item.status == 2">查看物流</button>
				</view>
			</view>
		</view>
		<view class="display column calc myOrderList borderR" v-if="type=='orderDetails'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre" @click="shopClick(orderList.supplier_content.id)">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{orderList.supplier_content.supplier_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
				</view>
				<view class="display column">
					<view class="display flow orderItemAre" @click="goodsClick(orderList.product_content.id)">
						<image :src="orderList.product_content.head_img" class="shopImg" ></image>
						<view class="display display_1 column orderItemBoxAre">
							<view class="display flow orderItemBox">
								<view class="display column orderItem" style="width: 80%;">
									<text class="fontHide">{{orderList.product_content.product_name}}</text>
								</view>
								<view class="display column orderItem" style="align-items: flex-end;">
									<text>{{orderList.product_content.integral}}积分</text>
									<text class="pColor">x{{orderList.num}}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import util from '@/common/util.js'
	export default {
		name: "myOrderList",
		props: ['orderList','type'],
		data() {
			return {
				
			};
		},
		methods:{
			shopClick(id){
				uni.navigateTo({
					url: '/subPackages/goods/shopAre/shopAre?shopId=' + id
				})
			},
			goodsClick(id){
				uni.navigateTo({
					url: '/subPackages/integral/integralShopDetails/integralShopDetails?id=' + id
				})
			},
			orderClick(id){
				uni.navigateTo({
					url: '/subPackages/integral/integralOrderDetails/integralOrderDetails?orderId=' + id
				})
			},
			//物流信息
			logisticsClick(list){
				uni.navigateTo({
					url: '/subPackages/mine/logisticsAre/logisticsAre?list=' + encodeURIComponent(JSON.stringify(list))
				})
			},
		}
	}
</script>

<style lang="scss">
	@import '@/common/css/myOrderList.scss';
</style>
